package com.sdruixinggroup.mondayb2b.interfaces;

import android.view.View;

import java.util.Calendar;

/**
 * Created by 00029935 on 2016/12/1.
 */

public abstract class NoDoubleClickListener implements View.OnClickListener {
    public static final int MIN_CLICK_DELAY_TIME = 1000;
    protected long lastClickTime = 0;

    @Override
    public void onClick(View v) {
            long corrent = Calendar.getInstance().getTimeInMillis();
            if(corrent - lastClickTime > MIN_CLICK_DELAY_TIME){
                lastClickTime = corrent;
                NoDoubleClick(v);
            }
    }

    public abstract void NoDoubleClick(View view);

}
